In [1]:
import warnings
warnings.filterwarnings('ignore')

In [1]:
%connect_info


{
  "stdin_port": 65376, 
  "ip": "127.0.0.1", 
  "control_port": 65377, 
  "hb_port": 65378, 
  "signature_scheme": "hmac-sha256", 
  "key": "7977e618-e7f7-4740-b204-1bb4d9407517", 
  "shell_port": 65374, 
  "transport": "tcp", 
  "iopub_port": 65375
}

Paste the above JSON into a file, and connect with:
    $> ipython <app> --existing <file>
or, if you are local, you can connect with just:
    $> ipython <app> --existing kernel-540c4f75-f706-47d2-81e9-726b4aa5f067.json 
or even just:
    $> ipython <app> --existing 
if this is the most recent IPython session you have started.

In [2]:
a = 4

In [2]:
import sunpy
import sunpy.map
import sunpy.lightcurve
import sunpy.data.test
import glob
%matplotlib inline
import matplotlib as mpl
from matplotlib import colors
mpl.rcParams['figure.figsize'] = (10, 9)
import matplotlib.pyplot as plt

Maps

Show all of the available color maps for Maps


In [3]:
path = sunpy.data.test.rootdir

In [4]:
from sunpy import cm
cm.show_colormaps()



In [5]:
gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient))
cmap_list = (plt.get_cmap('hot'), plt.get_cmap('Greys'), cm.get_cmap('sdoaia171'))
fig, axes = plt.subplots(nrows=len(cmap_list), figsize=(20, 5))
for ax, cmap in zip(axes, cmap_list):
    fig.subplots_adjust(top=0.95, bottom=0.01, left=0.2, right=0.99)
    ax.imshow(gradient, aspect='auto', cmap=cmap)


Comparing Color Space Normalizations


In [6]:
aiafull = sunpy.map.Map(sunpy.AIA_171_IMAGE)
# defining some constants to replicate how we currently plot AIA maps
mean = aiafull.mean()
std = aiafull.std()
vmin = max(0, mean - 3 * std)
vmax = min(aiafull.max(), mean + 3 * std)
print("max=%f, min=%f" % (aiafull.min(), aiafull.max()))
print("vmin=%f, vmax=%f" % (vmin, vmax))


max=-2.000000, min=9429.125000
vmin=0.000000, vmax=1113.218056

In [7]:
aia = aiafull

In [8]:
def plot_cmap_norm_compare(sunpy_map, map_min, map_max):
    # defining some constants to replicate how we currently plot AIA maps
    mean = sunpy_map.mean()
    std = sunpy_map.std()
    vmin = max(0, mean - 3 * std)
    vmax = min(sunpy_map.max(), mean + 3 * std)
    norms = (colors.Normalize(vmin, vmax), colors.Normalize(map_min, map_max), 
             colors.LogNorm(0.1, map_max), colors.PowerNorm(0.5, map_min, map_max), 
             colors.PowerNorm(0.4, map_min, map_max), colors.PowerNorm(0.3, map_min, map_max),
             colors.Normalize(map_min, map_max), colors.Normalize(map_min, map_max),
             colors.Normalize(map_min, map_max))
    gammas = (1,1,1,1,1,1,1,0.7, 0.4)
    names = ("Current", "Linear all range", "LogNorm", "PowerNorm 0.5", "PowerNorm 0.4", "PowerNorm 0.3", 
             "Linear Gamma 1", "Linear Gamma 0.7", "Linear Gamma 0.4")
    fig = plt.figure(figsize=(20, 20))
    for plot_num, name, norm, gamma in zip(range(len(names)), names, norms, gammas):
        fig.add_subplot(3, 3, plot_num)
        sunpy_map.plot_settings['norm'] = norm
        sunpy_map.plot_settings['cmap'].set_gamma(gamma)
        sunpy_map.plot_settings['title'] = name
        sunpy_map.plot()
        plt.colorbar()

The Full Sun


In [9]:
ax = plt.hist(aiafull.data, log=True)
plt.show()
print("max=%f, min=%f" % (aiafull.min(), aiafull.max()))


max=-2.000000, min=9429.125000

In [10]:
plot_cmap_norm_compare(aiafull, aiafull.min(), aiafull.max())


A submap including the limb


In [11]:
smap = aiafull.submap([0,1000], [0,1000])

In [12]:
ax = plt.hist(smap.data, log=True)
plt.show()
print("max=%f, min=%f" % (smap.min(), smap.max()))


max=6.937500, min=9429.125000

In [13]:
plot_cmap_norm_compare(smap, smap.min(), smap.max())


A submap not including the limb


In [14]:
smap = aiafull.submap([0,600], [0,600])

In [15]:
ax = plt.hist(smap.data, log=True)
plt.show()



In [16]:
plot_cmap_norm_compare(smap, smap.min(), smap.max())


Best solution looks like Linear with Gamma = 0.4

One disadvantage though is that there is visible banding in dark areas (see next)


In [17]:
smap = aiafull.submap([0,1000], [0,1000])
smap.plot_settings['norm'] = colors.Normalize(smap.min(), smap.max())
smap.plot_settings['cmap'].set_gamma(0.4)
smap.plot()
plt.colorbar()


Out[17]:
<matplotlib.colorbar.Colorbar instance at 0x10e98cdd0>

Checking with a full resolution AIA file


In [18]:
file = '/Users/schriste/Desktop/sunpy_test_img/aia.lev1.171A_2013-09-21T16_00_11.34Z.image_lev1.fits'
aiafull = sunpy.map.Map(file)
smap = aiafull.submap([-300,600], [-100,600])

In [19]:
ax = plt.hist(smap.data, log=True)
plt.show()
print("max=%f, min=%f" % (smap.min(), smap.max()))


max=24.000000, min=4967.000000

In [20]:
plot_cmap_norm_compare(smap, smap.min(), smap.max())


Testing Peek()

nothing to see here just reimplementing how we configured the plot before my changes


In [21]:
aia = sunpy.map.Map(sunpy.AIA_171_IMAGE)
#aia.plot_settings['norm'] = colors.LogNorm(1, aia.max())
mean = aia.mean()
std = aia.std()
vmin = max(0, mean - 3 * std)
vmax = min(aia.max(), mean + 3 * std)
aia.plot_settings['norm'] = colors.Normalize(vmin, vmax)
aia.peek(draw_limb=True)



In [22]:
aia = sunpy.map.Map(sunpy.AIA_171_IMAGE, sunpy.AIA_171_IMAGE, composite=True)
aia.set_levels(1, range(0, 50, 5), percent=True)
aia.set_colors(1, 'Reds_r')
aia.peek(draw_limb=True)



In [23]:
eit = sunpy.map.Map(sunpy.EIT_195_IMAGE)
eit.peek()



In [24]:
hsi = sunpy.map.Map(sunpy.RHESSI_IMAGE)
hsi.peek()



In [25]:
fitspath = glob.glob(os.path.join(path, "HinodeXRT.fits"))
xrt = sunpy.map.Map(fitspath)
xrt.peek()



In [26]:
fitspath = glob.glob(os.path.join(path, "HinodeSOT.fits"))
sot = sunpy.map.Map(fitspath)
sot.peek()


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-26-644e0fa9fa56> in <module>()
      1 fitspath = glob.glob(os.path.join(path, "HinodeSOT.fits"))
      2 sot = sunpy.map.Map(fitspath)
----> 3 sot.peek()

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/mapbase.pyc in peek(self, draw_limb, draw_grid, colorbar, basic_plot, **matplot_args)
   1008             axes = figure.gca()
   1009 
-> 1010         im = self.plot(axes=axes, **matplot_args)
   1011 
   1012         if colorbar and not basic_plot:

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/mapbase.pyc in plot(self, annotate, axes, **imshow_args)
   1098         kwargs.update(imshow_args)
   1099 
-> 1100         ret = axes.imshow(self.data, **kwargs)
   1101 
   1102         #Set current image (makes colorbar work)

/Users/schriste/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.pyc in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)
   4628                        filterrad=filterrad, resample=resample, **kwargs)
   4629 
-> 4630         im.set_data(X)
   4631         im.set_alpha(alpha)
   4632         if im.get_clip_path() is None:

/Users/schriste/anaconda/lib/python2.7/site-packages/matplotlib/image.pyc in set_data(self, A)
    432         if (self._A.ndim not in (2, 3) or
    433             (self._A.ndim == 3 and self._A.shape[-1] not in (3, 4))):
--> 434             raise TypeError("Invalid dimensions for image data")
    435 
    436         self._imcache = None

TypeError: Invalid dimensions for image data

In [27]:
fitspath = glob.glob(os.path.join(path, "mdi_fd_M_96m_01d.5874.0005_s.fits"))
mdi = sunpy.map.Map(fitspath)
mdi.peek()


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-27-db77fcb047fb> in <module>()
      1 fitspath = glob.glob(os.path.join(path, "mdi_fd_M_96m_01d.5874.0005_s.fits"))
----> 2 mdi = sunpy.map.Map(fitspath)
      3 mdi.peek()

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/map_factory.pyc in __call__(self, *args, **kwargs)
    244 
    245             try:
--> 246                 new_map = self._check_registered_widgets(data, meta, **kwargs)
    247             except (NoMatchError, MultipleMatchError, ValidationFunctionError):
    248                 if not silence_errors:

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/map_factory.pyc in _check_registered_widgets(self, data, meta, **kwargs)
    291         WidgetType = candidate_widget_types[0]
    292 
--> 293         return WidgetType(data, meta, **kwargs)
    294 
    295 

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/sources/soho.py in __init__(self, data, header, **kwargs)
    130         self._name = self.detector + " " + self.measurement
    131         self._nickname = self.detector + " " + self.measurement
--> 132         self.plot_settings['cmap'] = cm.get_cmap('Greys')
    133 
    134     @property

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/cm/cm.pyc in get_cmap(name)
    123         return cmlist.get(name)
    124     else:
--> 125         raise ValueError("Colormap %s is not recognized" % name)
    126 
    127 

ValueError: Colormap Greys is not recognized

In [28]:
fitspath = glob.glob(os.path.join(path, "lasco_c2_25299383_s.fts"))
lasco = sunpy.map.Map(fitspath)
lasco.peek()



In [29]:
fitspath = glob.glob(os.path.join(path, "iris_l2_20130801_074720_4040000014_SJI_1400_t000.fits"))
lasco = sunpy.map.Map(fitspath)
lasco.peek()


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-29-313b9aa8e10d> in <module>()
      1 fitspath = glob.glob(os.path.join(path, "iris_l2_20130801_074720_4040000014_SJI_1400_t000.fits"))
      2 lasco = sunpy.map.Map(fitspath)
----> 3 lasco.peek()

AttributeError: 'list' object has no attribute 'peek'

In [ ]:
fitspath = glob.glob(os.path.join(path, "cor1_20090615_000500_s4c1A.fts"))
lasco = sunpy.map.Map(fitspath)
lasco.peek()

In [30]:
fitspath = glob.glob(os.path.join(path, "aia_171_level1.fits"))
lasco = sunpy.map.Map(fitspath)
lasco.peek()



In [31]:
fitspath = glob.glob(os.path.join(path, "euvi_20090615_000900_n4euA_s.fts"))
lasco = sunpy.map.Map(fitspath)
lasco.peek()



In [15]:
import sunpy.map
import matplotlib.pyplot as plt
import glob
%matplotlib inline
import matplotlib as mpl
from matplotlib import colors
mpl.rcParams['figure.figsize'] = (10, 9)
path = '/Users/schriste/Desktop/sunpy_test_img/'
fits_files = glob.glob(os.path.join(path, "*"))
print(len(fits_files))


25

In [92]:
i = 22
m = sunpy.map.Map(fits_files[i])
m.plot_settings['norm'] = colors.Normalize(np.nanmin(m.data), np.nanmax(m.data))
m.plot_settings['cmap'] = plt.get_cmap('Greys')
print(fits_files[i])
print("max=%f, min=%f" % (m.min(), m.max()))
m.peek()


/Users/schriste/Desktop/sunpy_test_img/mdi.fd_M_lev182.2003.10.29_22_00_30_TAI.data.fits
max=nan, min=nan

In [104]:
m.meta


Out[104]:
MapMeta([('cunit2', 'arcsec'), ('obs_vn', -2879.839601), ('dsun_obs', 147033057689.92), ('t_obs', '2003.10.29_22:00:30_TAI'), ('mean_fld', -1.083746), ('simple', True), ('cdelt1', 1.983938), ('cdelt2', 1.983938), ('bfitzorg', -1.797), ('datavals', 760934), ('trecstep', 60.0), ('date-obs', '2003-10-29T21:59:43'), ('xy_from', 'SMOOTH'), ('dpc', 1212616640), ('date', '2012-03-08T22:48'), ('telescop', 'SOHO'), ('obs_vw', 29700.503618), ('datamean', -1.084), ('t_rec', '2003.10.29_22:00:30_TAI'), ('obs_vr', -367.004992), ('comment', "FITS (Flexible Image Transport System) format is defined in 'Astronomy  and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359HData from the Solar Oscillations Investigation / Michelson Doppler Imager (SOI/MDI) on the Solar and Heliospheric Observatory (SOHO)"), ('crop_rad', 504.0), ('runtime', '2003.11.07_00:38_UTC'), ('extend', True), ('rsun_obs', 976.384791), ('interval', 30.0), ('ctype1', 'HPLN-TAN'), ('datarms', 129.303116), ('datamedn', 0.148), ('caltbls', 'mdi.scale_corrections'), ('camera', 'MDI'), ('cunit1', 'arcsec'), ('crota2', 0.0), ('xy_qual', 0), ('blank', -2147483648), ('crlt_obs', 4.5728), ('x0', 511.89), ('history', ''), ('crln_obs', 276.146), ('ctype2', 'HPLT-TAN'), ('origin', 'SOI Science Support Center'), ('tot_flux', 29449966.6175), ('missvals', 0), ('waveunit', None), ('naxis1', 1024), ('r_sun', 492.145), ('roll_tbl', 'mdi.roll_table'), ('naxis2', 1024), ('tblxyupd', '2003.11.06_22:18:04_UTC'), ('datakurt', 135.195), ('content', 'MDI Full Disk 01-m Magnetogram'), ('earth_dt', 5.183078), ('source', 'prog:(null),level:(null)[-2147483648],series:(null)[-2147483648]'), ('wcsaxes', 2), ('avg_flux', 38.702393), ('datamin', -3512.1), ('bldver18', -60102), ('cadence', 1.0), ('bld_vers', 'V6R1X'), ('rsun_ref', 696000000), ('naxis', 2), ('bldver15', '50401'), ('trecepoc', '1993.01.01_00:00:30_TAI'), ('crval2', 0.0), ('crpix1', 512.89), ('crpix2', 511.34), ('crval1', 0.0), ('note1', 'Lev 1.8.2 created by fdmagcal on Thu Mar  8 14:48:51 2012.'), ('bzero', 0.0), ('note3', 'Ulrich 2008Version'), ('car_rot', 2009), ('wavelnth', 6768), ('keycomments', {'EXTEND': 'FITS dataset may contain extensions', 'NAXIS1': 'length of data axis 1', 'NAXIS2': 'length of data axis 2', 'NAXIS': 'number of data axes', 'SIMPLE': 'file does conform to FITS standard', 'BITPIX': 'number of bits per data pixel'}), ('sinrhotb', 'mdi.sinrho_table'), ('recnum', 2640976), ('datamax', 3361.9), ('bitpix', 32), ('note2', 'Magnetic Flat Field Correction per Ulrich et al. 2008'), ('y0', 510.34), ('bscale', 0.01), ('wcsname', 'Helioprojective-cartesian'), ('quality', 512), ('dataskew', 1.263), ('bunit', 'Gauss')])

In [86]:
plt.imshow(m.data)


Out[86]:
<matplotlib.image.AxesImage at 0x10dcd3d90>

In [80]:
m.wavelength


Out[80]:
6768

In [99]:
m.detector


Out[99]:
''

In [98]:
m.meta['camera']


Out[98]:
'MDI'

In [9]:
fig = plt.figure(figsize=(20, 20))
for plot_num, fits_file in zip(range(len(fits_files)), fits_files):
    fig.add_subplot(5, 5, plot_num)
    m = sunpy.map.Map(fits_file)
    m.plot()


/Users/schriste/anaconda/lib/python2.7/site-packages/matplotlib/axes/_subplots.py:69: MatplotlibDeprecationWarning: The use of 0 (which ends up being the _last_ sub-plot) is deprecated in 1.4 and will raise an error in 1.5
  mplDeprecation)
WARNING: VerifyWarning: Verification reported errors: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: Verification reported errors:
WARNING: VerifyWarning: HDU 0: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: HDU 0:
WARNING: VerifyWarning:     Card 77: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 77:
WARNING: VerifyWarning:         Unfixable error: Unprintable string 'offset_bias.pro\t1.30, 02/19/10, 398.366'; commentary cards may only contain printable ASCII characters [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Unfixable error: Unprintable string 'offset_bias.pro\t1.30, 02/19/10, 398.366'; commentary cards may only contain printable ASCII characters
WARNING: VerifyWarning: Note: PyFITS uses zero-based indexing.
 [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: Note: PyFITS uses zero-based indexing.

WARNING: VerifyWarning: HDU 1: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning: HDU 1:
WARNING: VerifyWarning:     Card 67: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 67:
WARNING: VerifyWarning:         Card 'OSCNMEAN' is not FITS standard (invalid value string: 'nan').  Fixed 'OSCNMEAN' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'OSCNMEAN' is not FITS standard (invalid value string: 'nan').  Fixed 'OSCNMEAN' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 68: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 68:
WARNING: VerifyWarning:         Card 'OSCNRMS' is not FITS standard (invalid value string: 'nan').  Fixed 'OSCNRMS' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'OSCNRMS' is not FITS standard (invalid value string: 'nan').  Fixed 'OSCNRMS' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 56: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 56:
WARNING: VerifyWarning:         Card 'CRDER1' is not FITS standard (invalid value string: 'nan').  Fixed 'CRDER1' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'CRDER1' is not FITS standard (invalid value string: 'nan').  Fixed 'CRDER1' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 57: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 57:
WARNING: VerifyWarning:         Card 'CRDER2' is not FITS standard (invalid value string: 'nan').  Fixed 'CRDER2' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'CRDER2' is not FITS standard (invalid value string: 'nan').  Fixed 'CRDER2' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 58: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 58:
WARNING: VerifyWarning:         Card 'CSYSER1' is not FITS standard (invalid value string: 'nan').  Fixed 'CSYSER1' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'CSYSER1' is not FITS standard (invalid value string: 'nan').  Fixed 'CSYSER1' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 59: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 59:
WARNING: VerifyWarning:         Card 'CSYSER2' is not FITS standard (invalid value string: 'nan').  Fixed 'CSYSER2' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'CSYSER2' is not FITS standard (invalid value string: 'nan').  Fixed 'CSYSER2' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 65: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 65:
WARNING: VerifyWarning:         Card 'DATAKURT' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATAKURT' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'DATAKURT' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATAKURT' card to meet the FITS standard.
WARNING: VerifyWarning:         Card 'DATAMEAN' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATAMEAN' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'DATAMEAN' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATAMEAN' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 70: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 70:
WARNING: VerifyWarning:         Card 'DATARMS' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATARMS' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'DATARMS' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATARMS' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 71: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 71:
WARNING: VerifyWarning:         Card 'DATASKEW' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATASKEW' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'DATASKEW' is not FITS standard (invalid value string: 'NAN /').  Fixed 'DATASKEW' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 102: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 102:
WARNING: VerifyWarning:         Card 'TDKURT1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDKURT1' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'TDKURT1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDKURT1' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 104: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 104:
WARNING: VerifyWarning:         Card 'TDMEAN1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDMEAN1' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'TDMEAN1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDMEAN1' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 107: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 107:
WARNING: VerifyWarning:         Card 'TDRMS1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDRMS1' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'TDRMS1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDRMS1' card to meet the FITS standard.
WARNING: VerifyWarning:     Card 108: [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:     Card 108:
WARNING: VerifyWarning:         Card 'TDSKEW1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDSKEW1' card to meet the FITS standard. [astropy.io.fits.verify]
WARNING:astropy:VerifyWarning:         Card 'TDSKEW1' is not FITS standard (invalid value string: 'NAN /').  Fixed 'TDSKEW1' card to meet the FITS standard.
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-9-1c9475ca41d0> in <module>()
      2 for plot_num, fits_file in zip(range(len(fits_files)), fits_files):
      3     fig.add_subplot(5, 5, plot_num)
----> 4     m = sunpy.map.Map(fits_file)
      5     m.plot()

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/map_factory.pyc in __call__(self, *args, **kwargs)
    233         silence_errors = kwargs.pop('silence_errors', False)
    234 
--> 235         data_header_pairs, already_maps = self._parse_args(*args, **kwargs)
    236 
    237         new_maps = list()

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/map_factory.pyc in _parse_args(self, *args, **kwargs)
    161                   os.path.isfile(os.path.expanduser(arg))):
    162                 path = os.path.expanduser(arg)
--> 163                 pairs = self._read_file(path, **kwargs)
    164                 data_header_pairs += pairs
    165 

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/map/map_factory.pyc in _read_file(self, fname, **kwargs)
     95         # File gets read here.  This needs to be generic enough to seamlessly
     96         #call a fits file or a jpeg2k file, etc
---> 97         pairs = read_file(fname, **kwargs)
     98 
     99         new_pairs = []

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/io/file_tools.pyc in read_file(filepath, filetype, **kwargs)
     68     for extension, readername in _known_extensions.items():
     69         if filepath.endswith(extension) or filetype in extension:
---> 70             return _readers[readername].read(filepath, **kwargs)
     71 
     72     # If filetype is not apparent from extension, attempt to detect

/Users/schriste/Dropbox/Developer/python/sunpy/sunpy/io/fits.pyc in read(filepath, hdus)
     82         pairs = []
     83         for hdu,header in itertools.izip(hdulist, headers):
---> 84             pairs.append((hdu.data, header))
     85     finally:
     86         hdulist.close()

/Users/schriste/anaconda/lib/python2.7/site-packages/astropy/utils/misc.pyc in __get__(self, obj, owner)
    286             return obj.__dict__[self._key]
    287         except KeyError:
--> 288             val = self._fget(obj)
    289             obj.__dict__[self._key] = val
    290             return val

/Users/schriste/anaconda/lib/python2.7/site-packages/astropy/io/fits/hdu/table.pyc in data(self)
    348     @lazyproperty
    349     def data(self):
--> 350         data = self._get_tbdata()
    351         data._coldefs = self.columns
    352         data.formats = self.columns.formats

/Users/schriste/anaconda/lib/python2.7/site-packages/astropy/io/fits/hdu/table.pyc in _get_tbdata(self)
    586         # _AsciiColDefs class should be responsible for telling the table what
    587         # its dtype should be...
--> 588         itemsize = columns.spans[-1] + columns.starts[-1] - 1
    589         dtype = {}
    590 

IndexError: list index out of range

Lightcurve


In [32]:
from sunpy import lightcurve
from sunpy.time import TimeRange
tr = TimeRange('2011-06-07 06:00', '2011-06-07 08:00')

In [33]:
goes = lightcurve.GOESLightCurve.create(tr)
goes.peek()



In [34]:
noaa = lightcurve.NOAAIndicesLightCurve.create()
noaa.peek()



In [35]:
noaa = lightcurve.NOAAPredictIndicesLightCurve.create()
noaa.peek()



In [36]:
hsi = lightcurve.RHESSISummaryLightCurve.create(tr)
hsi.peek()



In [37]:
eve = lightcurve.EVELightCurve.create(tr)
eve.peek()



In [38]:
import datetime
base = datetime.datetime.today()
dates = [base - datetime.timedelta(seconds=x) for x in range(0, 1 * 60 * 60)]
z = [((d.minute % 5) == 0) for d in dates]
light_curve = lightcurve.LogicalLightCurve.create({"param1": z}, index=dates)
light_curve.peek()



In [39]:
lyra = lightcurve.LYRALightCurve.create()
lyra.peek()



In [40]:
norh = lightcurve.NoRHLightCurve.create('2011/08/10')
norh.peek()



In [ ]:


In [ ]: